<template>
    <div class="pagination">
        <el-pagination v-model:current-page="currentPage" v-model:page-size="pageSize" :page-sizes="[5, 10, 15, 20]"
            :size="size" :disabled="disabled" :background="background" layout="total, sizes, prev, pager, next, jumper"
            :total="total" @size-change="handleSizeChange" @current-change="handleCurrentChange" />
    </div>
</template>

<script setup lang="ts">
import { defineProps, ref, defineEmits } from "vue";
import type { ComponentSize } from "element-plus";
const cureSize = ref(10);
const sizrentPage = ref(1);
const page = ref<ComponentSize>("default");
const disabled = ref(false);
const background = ref(true);
const props = defineProps({
    total: {
        type: Number,
    },
});

const emit = defineEmits(["changePage", "changeRows"]);
const handleSizeChange = (val: number) => {
    //   console.log(`${val} items per page`)
    emit("changeRows", val);
};
const handleCurrentChange = (val: number) => {
    //   console.log(`current page: ${val}`)
    emit("changePage", val);
};
</script>
<style lang="scss" scoped>
.pagination::v-deep {
    margin-top: 12px;
    display: flex;
    // justify-content: center;
    align-items: center;
}
</style>